package com.springboot.seckill.service;

import com.springboot.seckill.error.BusinessException;
import com.springboot.seckill.service.model.UserModel;

/**
 * @Author: HuangDekai
 * @Date: 2022/3/7 18:02
 * @Version: 1.0
 * @since: jdk11
 */
public interface UserService {
    /**
     * 调用UserDOMapper获取对应用户的DataObject
     * @param id 用户数据库主键id
     */
    UserModel getUserById(Integer id);

    /**
     * 对应用户注册的流程
     * @param userModel userModel
     */
    void register(UserModel userModel) throws BusinessException;

    /**
     * 验证登录时的telphone和passowrd(此时应该已经MD5加密)
     * @param telphone telphone, 手机号
     * @param encrptPassword encrptPassword, MD5加密过的密码
     */
    UserModel validateLogin(String telphone, String encrptPassword) throws BusinessException;
}
